package com.menghao.sso.server.model.credentials;

import java.net.URL;

/**
 * 表示基于HTTP的服务的凭证。 基于HTTP的服务（如Web应用程序）通常由应用程序的URL入口点表示。
 */
public class HttpBasedServiceCredentials implements Credentials {

    private static final long serialVersionUID = 3904681574350991665L;

    private final URL callbackUrl;

    public HttpBasedServiceCredentials(final URL callbackUrl) {
        if (callbackUrl == null) {
            throw new IllegalArgumentException("callbackUrl must be set on "
                    + this.getClass().getName());
        }
        this.callbackUrl = callbackUrl;
    }

    public final URL getCallbackUrl() {
        return this.callbackUrl;
    }

    public final String toString() {
        return this.callbackUrl.toExternalForm();
    }
}
